<!DOCTYPE html>
<html>
<head>
	<title>{:config('setting.admin_title')}</title>
	<!-- {if(false!==strpos(request()->domain(),'veishou'))} -->
	<link rel="icon" href="/weishou_logo.png" type="image/x-icon"/>
	<!-- {/if} -->
	<meta charset="utf-8">
	<meta name="renderer" content="webkit"/>
    <meta name="force-rendering" content="webkit"/>
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1"/>
    <script>/*@cc_on window.location.href="{:url('index/index/browser')}" @*/</script>
	
	<script src="{:_static()}/cdn/jquery.min.3.2.1.js"></script>
	<script src="{:_static()}/cdn/vue.min.2.5.16.js"></script>
	<!-- <script src="https://cdn.bootcss.com/jquery/3.2.1/jquery.min.js"></script> -->
	<!-- <script src="https://cdn.bootcss.com/vue/2.5.16/vue.min.js"></script> -->
	<!-- 引入样式 -->
	<!-- <link rel="stylesheet" href="{:_static()}/cdn/element-ui.2.4.2.css"> -->
	<link rel="stylesheet" href="https://cdn.staticfile.org/element-ui/2.4.2/theme-chalk/index.css">
	<!-- 引入组件库 -->
	<!-- <script src="{:_static()}/cdn/element-ui.2.4.2.js"></script> -->
	<script src="https://cdn.staticfile.org/element-ui/2.4.2/index.js"></script>
	<script type="text/javascript" src="{:_static()}/js/mixins.js"></script>
	<link rel="stylesheet" href="{:_static()}/css/style.css">
	<style>
	html,body{height:100%;}
	</style>
</head>
<body class="bg2">
	<div id="app">
		<div class="login-box">
		  <div class="lb-logo">
		    <!-- <h3><a href="/">{:config('setting.admin_title')}系统</a></h3> -->
			<!-- <p>登录{:config('setting.admin_title')}系统，感受智能操控新体验！</p> -->
		  </div>
		  <div class="lb-form">
		    <h3>后台登录</h3>
		    <div class="lb-tips" v-show="false">{{message}}</div>
		    <ul>
			  <li><input type="text" placeholder="用户名" v-model="data.name" class="lb-item txt user"></li>
			  <li><input type="password" placeholder="密码" v-model="data.pwd" class="lb-item txt psd"></li>
			  <li><input type="button" value="登录" class="lb-item btn" @click="login"></li>
			</ul>
		  </div>
		  <div class="lb-copyright">
		  	<p>
		  		<template v-if="address">
			  	地址：广西南宁市高薪区科园大道68 号东盟慧谷16栋1单元11层 
			  	</template>
			  	<template v-if="tel">
			  		| 联系电话：0771-3392135 
			  	</template>
			  	<template v-if="qq">
				| 联系QQ：3355836030
				</template>
			</p>
		  	<p v-if="copyright">版权所有：{{copyright}}</p>
		  </div>
		</div>
	</div>
</body>
</html>
<script>
var app=new Vue({
	el:"#app",
	mixins:[wsMixins],
	data:{
		address:"{:config('setting.address')}",
		tel:"{:config('setting.tel')}",
		qq:"{:config('setting.qq')}",
		copyright:"{:config('setting.copyright')}",
		
		data:{
			name:'',
			pwd:'',
		},
		message:'',
	},
	methods:{
		login(){

			if(!this.data.name.length){
				this.message='请输入用户名';
				this.$message({
				    message:this.message,
				    type:'warning'
				})
				return;
			}
			if(!this.data.pwd.length){
				this.message='密码不能为空';
				this.$message({
				    message:this.message,
				    type:'warning'
				})
				return;
			}
			this.message='';
			$.post("{:url('')}",this.data,res=>{
				if(res&&typeof res==='string'){
					res=JSON.parse(res);
				}
				if(res.code){
					this.$message({
					    message:res.msg,
					    type:'success'
					})
					setTimeout(function(){
					    location.href=res.url;
					},1500);
				}else if(res.msg){
					this.$message({
					    message:res.msg,
					    type:'warning'
					})
				}
			},'json');
		}
	}
});
</script>